<?php

include "classes/bd.php";
include "classes/usuario.php";
include "acao/segure.php";
$_user = new usuarios();
$dadosuser = $_user->getuserId($_SESSION['id']);

$pastamodulos = "modulos/";
$modulo = $_REQUEST["modulo"];
$acao 	= $_REQUEST["acao"];


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 
	<head>
		
		 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		
		<title>Sistema de administração - Usuario <?=$_SESSION['nome']?></title>
		
		<!--                       CSS                       -->
	  
		<!-- Reset Stylesheet -->
		<link rel="stylesheet" href="resources/css/reset.css" type="text/css" media="screen" />
	  
		<!-- Main Stylesheet -->
		<link rel="stylesheet" href="resources/css/style.css" type="text/css" media="screen" />
		
		<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
		<link rel="stylesheet" href="resources/css/invalid.css" type="text/css" media="screen" />	
		
		<!-- Colour Schemes
	  
		Default colour scheme is green. Uncomment prefered stylesheet to use it.
		
		<link rel="stylesheet" href="resources/css/blue.css" type="text/css" media="screen" />
		
		<link rel="stylesheet" href="resources/css/red.css" type="text/css" media="screen" />  
	 
		-->
		
		<!-- Internet Explorer Fixes Stylesheet -->
		
		<!--[if lte IE 7]>
			<link rel="stylesheet" href="resources/css/ie.css" type="text/css" media="screen" />
		<![endif]-->
		
		<!--                       Javascripts                       -->
  
		<!-- Ajax -->
        <script type="text/javascript" src="js/ejax.js"></script>
        <script type="text/javascript" src="../lib/fckeditor/fckeditor.js"></script>

        
        
        <script type="text/javascript" src="js/js.js"></script>
         <script type="text/javascript" src="../lytebox.js"></script>
         
        
        <script type="text/javascript" src="../Scripts/jquery-latest.js"></script>
        <script type="text/javascript" src="../Scripts/thickbox.js"></script>
        <link rel="stylesheet" href="../thickbox.css" type="text/css" media="screen" />
        

        
        
        
        <!-- jQuery -->
		<script type="text/javascript" src="resources/scripts/jquery-1.3.2.min.js"></script>
		
		<!-- jQuery Configuration -->
		<script type="text/javascript" src="resources/scripts/simpla.jquery.configuration.js"></script>
		
		<!-- Facebox jQuery Plugin -->
		<script type="text/javascript" src="resources/scripts/facebox.js"></script>
		
		<!-- jQuery WYSIWYG Plugin -->
		<script type="text/javascript" src="resources/scripts/jquery.wysiwyg.js"></script>
		
		<!-- jQuery Datepicker Plugin -->
		<script type="text/javascript" src="resources/scripts/jquery.datePicker.js"></script>
		<script type="text/javascript" src="resources/scripts/jquery.date.js"></script>
		<!--[if IE]><script type="text/javascript" src="resources/scripts/jquery.bgiframe.js"></script><![endif]-->

		
		<!-- Internet Explorer .png-fix -->
		
		<!--[if IE 6]>
			<script type="text/javascript" src="resources/scripts/DD_belatedPNG_0.0.7a.js"></script>
			<script type="text/javascript">
				DD_belatedPNG.fix('.png_bg, img, li');
			</script>
		<![endif]-->
		
	    <link href="../lytebox.css" rel="stylesheet" type="text/css" />
    </head>
  
	<body><div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
		
		<div id="sidebar"><div id="sidebar-wrapper"> <!-- Sidebar with logo and menu -->	
        
			<p>&nbsp;</p>		
			<h1 id="sidebar-title"><a href="#">solmais</a></h1>
		  
			<!-- Logo (221px wide) -->
			<h4 align="center"><span class="TitulosLogo">solmais</span></h4>
		  
			<!-- Sidebar Profile links -->
			<div id="profile-links">
				Ol&aacute;, <a href="#" title="Edit your profile"><?=$_SESSION['nome']?></a>.
				<a href="acao/usuario.php?acao=usuario_sair" title="Sair do sistema">Sair</a>
			</div>        
			
			<ul id="main-nav">  <!-- Accordion Menu -->
            
            				
				<li>
					<a href="index.php" class="nav-top-item no-submenu <? if(!$_GET['modulo']){echo ' current';}else{ echo "";}?>">
                    Inicio
					</a>       
				</li>
				
				<?php 
	
	$ssqlm = mysql_query("SELECT s.*, m.*  FROM sessao s,menu m WHERE s.id_user = ".$_SESSION['id']." AND s.id_sessao = m.id  GROUP BY m.pasta ORDER BY m.menu ");

	
	while($rowmenu = mysql_fetch_array($ssqlm)){
		?>
                
                <li> 
					<a href="#" class="nav-top-item<? if($_GET['modulo']== $rowmenu['pasta']){echo ' current';}else{ echo "";}?>"> <!-- Add the class "current" to current menu item -->
					<?=$rowmenu['menu']?>
					</a>
					<ul>
						<li><a <?php if($_GET["acao"]== "lista"){ echo "class=\"current\""; } ?> href="?modulo=<?=$rowmenu['pasta']?>&amp;acao=lista">Listar</a></li>
						<li><a <?php if($_GET["acao"]== "insere"){ echo "class=\"current\""; } ?> href="?modulo=<?=$rowmenu['pasta']?>&amp;acao=insere">Inserir</a></li> <!-- Add class "current" to sub menu items also -->
					</ul>
				</li>

<?
		
		}
	
	
?>				
			</ul><!-- End #main-nav -->
			
			<div id="messages" style="display: none"> <!-- Messages are shown when a link with these attributes are clicked: href="#messages" rel="modal"  -->
				
				<h3>3 Messages</h3>
			 
				<p>
					<strong>17th May 2009</strong> by Admin<br />
					Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue.
					<small><a href="#" class="remove-link" title="Remove message">Remove</a></small>
				</p>
			 
				<p>
					<strong>2nd May 2009</strong> by Jane Doe<br />
					Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.
					<small><a href="#" class="remove-link" title="Remove message">Remove</a></small>
				</p>
			 
				<p>
					<strong>25th April 2009</strong> by Admin<br />
					Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis aliquet congue.
					<small><a href="#" class="remove-link" title="Remove message">Remove</a></small>
				</p>
				
				<form action="" method="post">
					
					<h4>New Message</h4>
					
					<fieldset>
						<textarea class="textarea" name="textfield" cols="79" rows="5"></textarea>
					</fieldset>
					
					<fieldset>
					
						<select name="dropdown" class="small-input">
							<option value="option1">Send to...</option>
							<option value="option2">Everyone</option>
							<option value="option3">Admin</option>
							<option value="option4">Jane Doe</option>
						</select>
						
						<input class="button" type="submit" value="Send" />
						
					</fieldset>
					
				</form>
				
			</div> <!-- End #messages -->
			
		</div></div> <!-- End #sidebar -->
		
		<div id="main-content"> <!-- Main Content Section with everything -->
			
			<noscript> <!-- Show a notification if the user has disabled javascript -->
				<div class="notification error png_bg">
					<div>
						Javascript is disabled or is not supported by your browser. Please <a href="../../../browsehappy.com/index.htm" title="Upgrade to a better browser">upgrade</a> your browser or <a href="../../../www.google.com/support/bin/answer_2EEFB1D5.py" title="Enable Javascript in your browser">enable</a> Javascript to navigate the interface properly.
					</div>
				</div>
			</noscript>
            
            
			 <?php if(!isset($modulo,$acao)){ ?>
			<!-- Page Head -->
           
			<h2>Bem-vindo <?=$_SESSION['nome']?></h2>
			<p id="page-intro">O que você gostaria de fazer agora?</p>
			
			<ul class="shortcut-buttons-set">
				
				<li><a class="shortcut-button" href="?modulo=noticias&amp;acao=insere"><span>
				<img src="resources/images/icons/pencil_48.png" alt="icon" /><br />
					Novo produto </span></a></li>
				
		        <!--		<li><a class="shortcut-button" href="?modulo=dados&amp;acao=edita&amp;id=<?php echo $_SESSION['id'] ?>"><span>
				<img src="resources/images/icons/paper_content_pencil_48.png" alt="icon" /><br />
					Alterar dados</span></a></li>-->
				
	    <li><a class="shortcut-button" href="?modulo=midia&acao=insere"><span>
					<img src="resources/images/icons/image_add_48.png" alt="icon" /><br />
					Adicionar Midia
				</span></a></li>
			</ul>
			<!-- End .shortcut-buttons-set -->
            <?php }else{ ?>
            <div class="content-box-header">
					
					<h3><?php echo getnomemenu($modulo); ?></h3>
					
					
					
					<div class="clear"></div>
					
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
                
                <?  if($_GET["notificacao"]){ ?>

 <div class="notification <?php echo $_GET["notificacao"] ?> png_bg">

				<a href="#" class="close"><img src="resources/images/icons/cross_grey_small.png" title="Fechar esse dialogo" alt="close" /></a>
				<div>
                <?php echo $_GET["msg"] ?>
                </div>
			</div>
            
            
            
            <? } ?>




            <?php include $pastamodulos . $modulo . "/" . $acao . ".php"; ?>

            
            
            
             <? } ?>
            
            
            
			
			<div class="clear"></div> <!-- End .clear -->
			<!-- End .content-box -->
			<!-- End .content-box -->
			<!-- End .content-box -->
<div class="clear"></div>
			
			
			<!-- Start Notifications --><!-- End Notifications -->
<div id="footer">
				<small> <!-- Remove this notice or replace it with whatever you want -->
		  &#169; Copyright 2010 <a href="#">JERIMUM WEB</a></small></div>
<!-- End #footer -->
			
		</div> <!-- End #main-content -->
		
	</div></body>
  
</html>
